![New Socket Web Extension, Take Socket with You](https://cdn.sanity.io/images/cgdhsj6q/production/7c7e90f37af51d175eaf8b2ae56124aec35c57c8-874x566.png?w=400&fit=max&auto=format)
Product
New Socket Web Extension, Take Socket with You
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
@pixi/utils
Advanced tools
Package description
@pixi/utils is a utility library that provides a collection of helper functions and classes to assist with common tasks in the PixiJS ecosystem. It includes utilities for data structures, math operations, string manipulations, and more.
EventEmitter
The EventEmitter class provides a way to handle custom events. You can create an instance, register event listeners, and emit events.
const { EventEmitter } = require('@pixi/utils');
const emitter = new EventEmitter();
emitter.on('event', () => console.log('Event triggered!'));
emitter.emit('event');
isMobile
The isMobile utility helps to detect if the user is on a mobile device. It provides properties to check for various mobile platforms.
const { isMobile } = require('@pixi/utils');
console.log(isMobile.any); // true if the user is on a mobile device
uid
The uid function generates a unique identifier, which can be useful for creating unique keys or IDs.
const { uid } = require('@pixi/utils');
console.log(uid()); // Generates a unique identifier
deprecation
The deprecation function logs a deprecation warning to the console, which is useful for informing developers about deprecated methods or features.
const { deprecation } = require('@pixi/utils');
deprecation('1.0.0', 'This method is deprecated, use newMethod instead.');
Lodash is a modern JavaScript utility library delivering modularity, performance, and extras. It provides a wide range of utility functions for common programming tasks, similar to @pixi/utils but with a broader scope.
EventEmitter3 is a high-performance EventEmitter for Node.js and the browser. It offers similar event handling capabilities as the EventEmitter in @pixi/utils but is more focused and optimized for performance.
UUID is a library for generating RFC-compliant UUIDs. It provides similar functionality to the uid function in @pixi/utils but is specifically focused on generating universally unique identifiers.
Readme
npm install @pixi/utils
import * as utils from '@pixi/utils';
FAQs
Collection of utilities used by PixiJS
The npm package @pixi/utils receives a total of 89,265 weekly downloads. As such, @pixi/utils popularity was classified as popular.
We found that @pixi/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Can you spot malicious malicious packages on the web at a glance? Socket can. Check out our updated Web Extension!
Product
Socket introduces three new customizable default security policies for users to choose from: Low Noise (traditional SCA), Default, and Higher Noise.
Security News
MITRE has just minted its 400th CNA, as the NVD struggles to tame its backlog of CVEs awaiting analysis, which has increased by 30% since June.